// 封装web服务
const myweb = require('./myweb')
const fs = require('fs')
const app = myweb()

app.get('/home', (req, res) => {
  // res.send({ id: 1 })
  // res.send([1, 2])
  res.send(fs.readFileSync('./web/home.html'))
})

app.post('/login', (req, res) => {
  let body = req.body || {}
  
  res.send({...body})
})

app.listen(3000, '0.0.0.0', () => {
  console.log('http://localhost:3000')
})